From 29822cad4f28b830a68fc7288ecfaef16d4af71d Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Wed, 9 Feb 2005 00:02:37 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.557 (4209531dcD_85ru3nT6SL_v6qHidAA) Subject: [PATCH] mmio-decode-movz.patch - Handle the movz instruction in the decoder. This was necessary to get X working. Signed-off-by: Chengyuan Li Signed-off-by: Arun Sharma Signed-off-by: ian@xensource.com --- xen/arch/x86/vmx_platform.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/xen/arch/x86/vmx_platform.c b/xen/arch/x86/vmx_platform.c index c3df043de9..284243eca1 100644 --- a/xen/arch/x86/vmx_platform.c +++ b/xen/arch/x86/vmx_platform.c @@ -338,7 +338,20 @@ static int vmx_decode(const unsigned char *inst, struct instruction *thread_inst switch (*inst) { /* movz */ + case 0xb6: + index = get_index((inst + 1)); + if (thread_inst->op_size == WORD) { + thread_inst->operand[1] = mk_operand(WORD, index, 0, REGISTER); + } else { + thread_inst->operand[1] = mk_operand(LONG, index, 0, REGISTER); + + } + thread_inst->op_size = BYTE; + strcpy(thread_inst->i_name, "movzb"); + + return DECODE_success; case 0xb7: + thread_inst->op_size = WORD; index = get_index((inst + 1)); thread_inst->operand[1] = mk_operand(LONG, index, 0, REGISTER); strcpy(thread_inst->i_name, "movzw"); @@ -495,28 +508,15 @@ void handle_mmio(unsigned long va, unsigned long gpte, unsigned long gpa) store_xen_regs(inst_decoder_regs); // Only handle "mov" and "movs" instructions! - if (!strncmp(mmio_inst.i_name, "movzw", 5)) { - long value = 0; - int index; - + if (!strncmp(mmio_inst.i_name, "movz", 4)) { if (read_from_mmio(&mmio_inst)) { // Send the request and waiting for return value. mpci_p->mmio_target = mmio_inst.operand[1] | WZEROEXTEND; - mmio_inst.op_size = WORD; - send_mmio_req(gpa, &mmio_inst, value, 1, 0); + send_mmio_req(gpa, &mmio_inst, 0, 1, 0); + return ; } else { - // Write to MMIO - if (mmio_inst.operand[0] & IMMEDIATE) { - value = mmio_inst.immediate; - } else if (mmio_inst.operand[0] & REGISTER) { - index = operand_index(mmio_inst.operand[0]); - value = get_reg_value(WORD, index, 0, inst_decoder_regs); - } else { - domain_crash(); - } - mmio_inst.op_size = WORD; - send_mmio_req(gpa, &mmio_inst, value, 0, 0); - return; + printk("handle_mmio - EXIT: movz error!\n"); + domain_crash(); } } -- 2.30.2